package com.googlecode.flealancemarket.core.persistence;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.transaction.annotation.Transactional;

public interface PersistenceFacade {

	@Transactional
	<T> List<T> read(Class<T> clazz);

	@Transactional
	<T> T readUnique(Class<T> clazz, Long id);

	@Transactional
	<T> T write(T input);

	@Transactional
	<T> List<T> write(List<T> inputs);

	@Transactional
	<T> T delete(T forgotten);

	@Transactional
	<T> List<T> delete(List<T> forgottenOnes);

	@Transactional
	List<?> attachCriteria(DetachedCriteria detached);
	
	SessionFactory getSessionFactory();
	
	void setSessionFactory(SessionFactory sessionFactory);



}